import service from '@/utils/request.ts'
import {ApiResponse,ListApiResponse} from '@/store/dataType.ts'

export const API_DICT_DATA = {
  // 查询字典数据列表
  listData:(query:any):Promise<ListApiResponse> => {return service.get('/system/dict/data/list',{ params: query})},
  // 查询字典数据详细
  getData:(dictCode:number):Promise<ApiResponse>=> {return service.get('/system/dict/data/' + dictCode)},
  // 根据字典类型查询字典数据信息,例如传入sys_oper_type
  getDicts:(dictType:string):Promise<ApiResponse> => {return service.get('/system/dict/data/type/' + dictType);},
  // 新增字典数据
  addData:(data:any):Promise<ApiResponse> =>{return service.post('/system/dict/data',data)},
  // 修改字典数据
  updateData:(data:any):Promise<ApiResponse> => {return service.put('/system/dict/data',data)},
  // 删除字典数据
  delData:(dictCode:string):Promise<ApiResponse> => {return service.delete('/system/dict/data/' + dictCode)}
}
 
